package com.bitin.module.project.domain.enumeration;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
/**
 * @author Mr.Lu
 * @since 2024/8/26 13:38
 */
@Getter
@JsonFormat( shape = JsonFormat.Shape.OBJECT )
public enum TransactionChannel {
    OFFLINE( "线下" ),
    ALIPAY( "支付宝" ),
    WECHAT( "微信" ),
    UNION_PAY( "银联" ),
    ALIPAY_APP( "alipay-app" ),
    ALIPAY_WAP( "alipay-wap" ),
    WECHAT_PAY_APP( "wechat-pay-app" ),
    WECHAT_PAY_JS_API( "wechat-pay-js-api" ),
    WECHAT_PAY_H5( "wechat-pay-h5" ),
    ;
    private final String display;
    private final String value = name( );

    TransactionChannel( String display ) {
        this.display = display;
    }

//    @JsonCreator
//    public static TransactionChannel deserialize( JsonNode node ) {
//        return Optional.ofNullable( node.get( "value" ) )
//                .map( value -> TransactionChannel.valueOf( value.asText( ) ) )
//                .orElseThrow( ( ) -> new IllegalArgumentException( node.asText( ) ) );
//    }
}
